#include <iostream>
#include <string>

using namespace std;

class person
{
public:
    int m_age;
    string m_name;
    int * m_weight;

    person(int age, int  weight)
    {
        m_age=age;
        m_weight = new int (weight);
        cout<<"youcan"<<endl;
        
    }

    ~person()
    {
        cout<<"xigou"<<endl;
        if(m_weight != NULL)
        {
            delete m_weight;
            m_weight = NULL;
        }


    }

    person (const person & p)
    {
        m_age=p.m_age;
        m_weight = new int (*p.m_weight);
    }
       
};

int main()
{
    person p1(18,140);

    person p2(p1);

    cout<<p1.m_age<<"    "<<p1.m_weight<<endl;
    cout<<p2.m_age<<"    "<<p2.m_weight<<endl;



}

